package com.wuwu.springcloud.controller;

import com.wuwu.springcloud.pojo.Dept;
import com.wuwu.springcloud.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class DeptConsumerFeignController {
    @Autowired
    private DeptClientService deptClientService = null;

    @RequestMapping("/consumer/dept/get/{id}")
    public Dept get(@PathVariable("id") Long id){
        // 路径+ dept +  返回值 类型
        return  this.deptClientService.queryBuId(id);
    }
    @RequestMapping("/consumer/dept/add")
    public boolean add(Dept dept){
        // 路径+ dept + 返回值类
        return this.deptClientService.addDept(dept) ;
    }
    @RequestMapping("/consumer/dept/list")
    public List<Dept> query(){
        return this.deptClientService.queryList() ;
    }
}
